<div class="mbx">
  <div class="col-lg-12 index">
    <i class="glyphicon glyphicon-home"></i>
    首页 > <a href="#">控制台</a>
  </div>
</div>

<div class="col-md-12" align="center">
    <div id="main" class="col-xs-12"  style="height: 750px;">
    	<table class="" style=" width:100%;">
    		<tr >
    			<td  style=" padding:10px;">
    			  <div class="top-sk-dis01 color-01">
    			     <div class="d01" >●  教程数量   ●</div>
    			     <p class="p02" id="lessonCount">10</p>
    			     <p class="p03">
    			       <span></span>
    			        <a href="admin/index#column/getSubPage"> <img src="assets/htwj/more.png">&nbsp;&nbsp;更多详情</a>
    			     </p>
    			  </div>
    			</td>
    			<td  style=" padding:10px;">
    			  <div class="top-sk-dis01 color-02">
    			     <div class="d01" >●  模型数量   ●</div>
    			     <p class="p02" id="moduleCount">5</p>
    			     <p class="p03">
    			       <span></span>
    			       <a href="admin/index#admin/manage/63"> <img src="assets/htwj/more.png">&nbsp;&nbsp;更多详情</a>
    			     </p>
    			  </div>
    			</td>
    			<td  style=" padding:10px;">
    			  <div class="top-sk-dis01 color-03">
    			     <div class="d01" >● 预约次数   ●</div>
    			     <p class="p02" id="reserveNum">8</p>
    			     <p class="p03">
    			       <span></span>
    			       <a href="admin/index#admin/manage/66"> <img src="assets/htwj/more.png">&nbsp;&nbsp;更多详情</a>
    			     </p>
    			  </div>
    			</td>

    		</tr>
    	</table>
   	<div class="col-md-6 col-sm-12">
    	<div id="main1" style="height:400px;padding-top: 25px;padding-left: 45px;"></div>
    </div>
	<div class="col-md-6 col-sm-12">
		<div id="main2" style="height:400px;padding-top: 25px;padding-left: 45px;"></div>
	</div>
    </div>
  
	</div>
<script type="text/javascript" src="assets/js/echarts.min.js"></script>
<script type="text/javascript">
function init(){
	$.get("admin/teastatistical",function(data){//教程数量
		if(data.code == 0){
			$("#lessonCount").html(data.content.lessonCount);
		}
	});
	$.get("threed/getThreedNum2",function(data){//模型数量
		if(data.code == 0){
			$("#moduleCount").html(data.content);
		}
	});
	$.get("printerReserve/reserveNum",function(data){//预约数量
		if(data.code == 0){
			$("#reserveNum").html(data.content);
		}
	});
	//getLiveData();
	//getLessonData();
}
init();

function getLiveData(){
	 $.post("statistical/getWeekLessonData",function(data){
		 
		 var myChart = echarts.init(document.getElementById('main1'));
		 var option;
		 option = {
		            title: {
		            	 text: '近一周直播观看情况统计图',
		            },
		            tooltip: {},
		            legend: {
		            	  data:['观看人数'],
		            	  x: 'right'
		            
		            },
		            grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '3%',
				        containLabel: true
				    },
		            xAxis: {
		            	  data: data.Xdata
		            },
		            yAxis: {},
		            series: [{
		            	name:'观看人数',
		                type: 'bar',
		                data: data.Ydata
		            }]
		        };

		 myChart.setOption(option);
		 
	 });
}

function getLessonData(){
	 $.post("statistical/getweekLessonView",function(data){
		 var myChart = echarts.init(document.getElementById('main2'));
		 var option;
		 option = {
				    title: {
				        text: '近一周课程观看情况统计图',
				    },
				    tooltip: {
				        trigger: 'axis'
				    },
				    legend: {
				        data:['观看人数'],
				        x: 'right'
				    },
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '3%',
				        containLabel: true
				    },
				    toolbox: {
				        
				    },
				    xAxis: {
				        type: 'category',
				        boundaryGap: false,
				        data: data.Xdata
				    },
				    yAxis: {
				        type: 'value'
				    },
				    series: [
				        {
				            name:'观看人数',
				            type:'line',
				            stack: '总量',
				            data: data.Ydata
				        }
				    ]
				};

		 myChart.setOption(option);
		 
	 });
}
</script>